
	<div class="form-list">
		<?php admin_msg( $msg ); ?>
		
		<form name="list" action="<?php echo admin_link( 'menu/index/'.$place_id ) ?>" method="post">
		<div class="box-right">
			<strong>Hiển thị theo </strong>
            <input <?php if( $place_id == 0 ) echo 'checked="checked"'; ?> type="radio" name="place" value="1" onclick="change_url( 'menu/index/0' )" /> <span>Trên đầu</span>
            <input <?php if( $place_id == 1 ) echo 'checked="checked"'; ?> type="radio" name="place" value="2" onclick="change_url( 'menu/index/1' )" /> <span>Bên phải</span>
            <input <?php if( $place_id == 2 ) echo 'checked="checked"'; ?> type="radio" name="place" value="3" onclick="change_url( 'menu/index/2' )" /> <span>Phía dưới</span>
            <input <?php if( $place_id == 3 ) echo 'checked="checked"'; ?> type="radio" name="place" value="4" onclick="change_url( 'menu/index/3' )" /> <span>Bên trái</span>
            
		</div>
		
		<div class="clear-all"></div>
		
		<table border="1" class="form-list-table">
			<tr>
				<th rowspan="2" width="50">TT</th>
				<th rowspan="2" class="title">Tên menu</th>
				<th colspan="3" width="210">Tùy chọn</th>
			</tr>
			<tr>
				<th width="70">Hiển thị</th>
				<th width="70">Sửa</th>
				<th width="70">Xóa</th>
			</tr>
            <?php 
            if ( $items ) {
            	
            	$k = 1;
            	
				foreach ( $items as $item ) {
					
					$status =  ( $item['status'] == 1 ) ? 'checked="checked"' : '';	
					
					echo '<tr>';
						echo '<td><input type="hidden" name="id_'.$k.'" value="'.$item['id'].'" /><input name="order_'.$k.'" value="'.$item['orders'].'" type="text" class="text text-numb2" /></td>';
						echo '<td class="title">';
							echo '<p class="menu-name">'.$item['name'].'</p>';
							if ( $item['description'] ) 
								echo '<p class="menu-desc">'.$item['description'].'</p>';
							
							if ( $item['link'] != NULL && $item['link'] != 'http://' ) {
								
								$find = 'http://';
			 					$pos = strpos( $item['link'], $find );
			 					
			 					echo '<p class="menu-link">';
			 					if ($pos !== false) 
			 						echo '<a target="_blank" class="a-link" href="'.$item['link'].'">'.$item['link'].'</a>';
			 					else 
			 						echo '<a target="_blank" class="a-link" href="'.base_url().$item['link'].'">'.base_url().$item['link'].'</a>';
			 					echo '</p>';	
							}
						echo '</td>';
						echo '<td><input type="checkbox" name="status_'.$k.'" value="1" '.$status.' /></td>';
						echo '<td><a href="'.admin_link( 'menu/edit/'.$item['id'] ).'" class="edit"><img width="20" height="19" src="'.admin_img().'spacer.gif" alt="Xóa" /></a></td>';
						echo '<td><a onclick="return confirm_del();" href="'.admin_link( 'menu/del/'.$item['id'].'/'.$item['place'] ).'" class="del"><img width="20" height="20" src="'.admin_img().'spacer.gif" alt="Xóa" /></a></td>';
					echo '</tr>';
					
					$k++;
				}echo '<tr><td colspan="8" class="no-data"><input type="hidden" name="length" value="'.$k.'" />Tổng số <strong>'.$total.'</strong> menu</td></tr>';
            }else echo '<tr><td colspan="5" class="no-data">Chưa có menu nào được tạo</td></tr>';
			?>					
		</table>
        
		<div class="box-right">
			<input type="submit" name="submit" value="Cập nhập" class="button" />
		</div>
        
        <div class="clear-all"></div>
        
		</form>
	</div>